﻿using Fuse8.DomainFramework.Domain;
using Fuse8.GlobalizationFramework.Infrastructure;

namespace Fuse8.GlobalizationFramework.Domain.Commands
{
    /// <summary>
    /// Command for retrieve all resources in locale
    /// </summary>
    public abstract class ResourceSelectAllByLocale : BaseEntityCommand<Resource>, ILocalizableEntity
    {
        /// <summary/>
        public override string CacheKey
        {
            get { return string.Format("Locale_{0};UseDefault_{1};Default_{2}", Locale, AppendDefault, DefaultLocale); }
        }

        /// <summary>
        /// Specifies using default locale
        /// </summary>
        public bool AppendDefault { get; set; }

        /// <summary>
        /// Default locale name
        /// </summary>
        public string DefaultLocale { get; set; }

        /// <summary/>
        public override string CommandName
        {
            get { return "ResourceSelectAllByLocale"; }
        }

        /// <summary>
        /// Current Locale
        /// </summary>
        public string Locale { get; set; }
    }
}